package com.zhehekeji.opsys.api.entity;

import java.util.Date;

// Generated 2015-4-16 14:47:40 by Hibernate Tools 3.4.0.CR1
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

/**
 * TCardInfo generated by hbm2java
 */
@Entity(name="com.zhehekeji.opsys.api.entity.TCardInfo")
@Table(name="t_card_info")
public class TCardInfo implements java.io.Serializable {

	/** 
	* @Fields serialVersionUID : TODO
	*/ 
	private static final long serialVersionUID = -1731959461999801751L;
	private Long id;
	private String name;
	private Integer totalCount = 0;
	private Integer generateCount = 0;
	private Integer useCount = 0;
	private Integer faceValue = 0;
	private Date expireDate;
	private Date createTime = new Date();
	private Integer status = 1;
	private TActivity tactivity;
	private Long cpCode;
	
	private Integer verctrl;
	public TCardInfo() {
	}

	public TCardInfo(Long id, String name, Integer totalCount,
			Integer generateCount, Integer useCount, Integer faceValue,
			Date expireDate, Date createTime, Integer status, Long cpCode) {
		this.id = id;
		this.name = name;
		this.totalCount = totalCount;
		this.generateCount = generateCount;
		this.useCount = useCount;
		this.faceValue = faceValue;
		this.expireDate = expireDate;
		this.createTime = createTime;
		this.status = status;
		this.cpCode = cpCode;
	}
	@ManyToOne(cascade=CascadeType.REFRESH,fetch=FetchType.EAGER,optional=true)
	@JoinColumn(name="ACTIVITY_ID")
	public TActivity getTactivity() {
		return tactivity;
	}

	public void setTactivity(TActivity tactivity) {
		this.tactivity = tactivity;
	}
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="ID",length=20,nullable=false,unique=true)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	@Column(name="NAME",length=128,nullable=true)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}
	@Column(name="TOTAL_COUNT",length=11,nullable=true)
	public Integer getTotalCount() {
		return this.totalCount;
	}

	public void setTotalCount(Integer totalCount) {
		this.totalCount = totalCount;
	}
	@Column(name="GENERATE_COUNT",length=11,nullable=true)
	public Integer getGenerateCount() {
		return this.generateCount;
	}

	public void setGenerateCount(Integer generateCount) {
		this.generateCount = generateCount;
	}
	@Column(name="USE_COUNT",length=11,nullable=true)
	public Integer getUseCount() {
		return this.useCount;
	}

	public void setUseCount(Integer useCount) {
		this.useCount = useCount;
	}
	@Column(name="FACE_VALUE",length=11,nullable=true)
	public Integer getFaceValue() {
		return this.faceValue;
	}

	public void setFaceValue(Integer faceValue) {
		this.faceValue = faceValue;
	}
	@Temporal(TemporalType.DATE)
	@Column(name="EXPIRE_DATE", nullable=true)
	public Date getExpireDate() {
		return this.expireDate;
	}

	public void setExpireDate(Date expireDate) {
		this.expireDate = expireDate;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="CREATE_TIME", nullable=true)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@Column(name="STATUS",length=2,nullable=true)
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
	@Column(name="CP_CODE",length=20,nullable=true)
	public Long getCpCode() {
		return this.cpCode;
	}

	public void setCpCode(Long cpCode) {
		this.cpCode = cpCode;
	}
	@Version
	@Column(name="VERCTRL",length=11,nullable=true)
	public Integer getVerctrl() {
		return verctrl;
	}

	public void setVerctrl(Integer verctrl) {
		this.verctrl = verctrl;
	}
}
